﻿using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

public class TurnUI : MonoBehaviour
{
    float Zeroonechange(float x)
    {
        if (x == 0.0f) x = 1;
        else x = 0;
        return x;
    }
    public RectTransform child;
    public RectTransform self;
    public FillController f;
    Vector2 v2;            
    Vector3 v3;
    string[] toswapname = { "fire", "boom", "shot", "tree", "water", "iorn1", "energy", "resource" };
    public void Swap()
    {
        foreach (string i in toswapname)
        {
            child = (RectTransform)self.Find(i);
            v2=child.anchorMin;
            v3 = child.anchoredPosition;
            v2.x = Zeroonechange(v2.x);
            child.anchorMin = v2;
            child.anchorMax = child.anchorMin;
            v3.x = -v3.x;
            child.anchoredPosition = v3;
        }
    }
}
